package com.medical.data.component;

import com.medical.data.vo.LoginUser;

public class LoginUserThreadLocal {

    //定义一个本地线程主要用于存储用户登录信息
    private static final ThreadLocal<LoginUser> loginUserThreadLocal = new ThreadLocal<>();

    //设置用户信息与线程联系

    public static void set(LoginUser loginUser){
        loginUserThreadLocal.set(loginUser);
    }

    //获取用户信息
    public static LoginUser get(){
        return loginUserThreadLocal.get();
    }

    //删除
    public static void remove(){
        loginUserThreadLocal.remove();
    }
}
